<template>
  <div style="width: 100%;padding: 25px 25px;border: 1px solid #417dc9;margin-bottom: 10px;">
    <div class="flex-column" style="gap: 10px;" v-if="type=='patent'">
        <div style="color: #1a4882;font-weight: 700">{{indexs}}:{{ searchInfo.titles[0] }}</div>
        <div>
            <span>[专利]</span>
            <span>{{ searchInfo.major }}</span>
            <span>{{ searchInfo.id }}</span>
            <span v-for="item in searchInfo.group.slice(0,4)" :key="item" style="color: #417dc9;">{{ item }}</span>等 -&nbsp;
            <span>申请日：{{ searchInfo.applicationDate }}</span>
            <span>公开日：{{ searchInfo.publicationDate }}</span>
        </div>
        <div>
            <span class="abstractStyle">{{ searchInfo.abstract }}</span>
        </div>
    </div>
    <div class="flex-column" style="gap: 10px;" v-else-if="type=='periodical'">
        <div style="color: #1a4882;font-weight: 700">{{indexs}}:{{ searchInfo.titles[0] }}</div>
        <div style="display: inline-block;">
            <span>[期刊论文]</span>
            <span class="linkColor" style="text-decoration: underline;" v-for="item in searchInfo.scholarIdAuthor.slice(0,3)" :key="item">{{ item }}</span>
                等 -
            <el-link type="primary" style="display: inline-block">《{{ searchInfo.periodicalTitle }}》</el-link>
            <div class="flex-row" style="gap: 8px;margin-right: 10px;display: inline-block;">
                <el-tag v-for="item in  searchInfo.corePeriodical" :key="item">{{ item }}</el-tag>
            </div>
            <el-link type="primary" style="display: inline-block;">{{ searchInfo.publishIssue }}</el-link>
        </div>
        <div >
            <span class="abstractStyle">{{ searchInfo.abstract }}</span>
        </div>
        <div class="flex-row">
            <span v-for="item in searchInfo.keywords" :key="item" style="text-decoration: underline;display: inline-block;">{{ item }}</span>
        </div>
    </div>
    <div class="flex-column" style="gap: 10px;" v-else-if="type=='conference'">
        <div style="color: #1a4882;font-weight: 700">{{indexs}}:{{ searchInfo.titles[0] }}</div>
        <div>
            <span>[会议论文]</span>
            <span class="linkColor" style="text-decoration: underline;" v-for="item in searchInfo.scholarIdAuthor.slice(0,3)" :key="item">{{ item }}</span>
                等 -
            <el-link type="primary">《{{ searchInfo.publishIssue }}》</el-link>
            <span class="linkColor" style="text-decoration: underline;" v-for="item in searchInfo.group.slice(0,3)" :key="item">{{ item }}</span>
                等 -
        </div>
        <div>
            <span class="abstractStyle">{{ searchInfo.abstract }}</span>
        </div>
        <div class="flex-row">
            <span v-for="item in searchInfo.keywords" :key="item" style="text-decoration: underline;display: inline-block;">{{ item }}</span>
        </div>
    </div>
    <div class="flex-column" style="gap: 10px;" v-else-if="type=='cstad'">
        <div style="color: #1a4882;font-weight: 700">{{indexs}}:{{ searchInfo.titles[0] }}</div>
        <div>
            <span>[科技成果]</span>
            <span>{{ searchInfo.id }}</span>
            <span>{{ searchInfo.province }}</span>
            <span class="linkColor" style="text-decoration: underline;" v-for="item in searchInfo.classCode" :key="item">{{ item }}</span>
            <span>{{ searchInfo.achievementType }}</span>
            <span v-for="item in searchInfo.tradeName" :key="item">{{ item }}</span>
            <span>{{searchInfo.year}}</span>
        </div>
        <div>
            <span class="abstractStyle">{{ searchInfo.abstract }}</span>
        </div>
        <div class="flex-row">
            <span v-for="item in searchInfo.keywords" :key="item" style="text-decoration: underline;display: inline-block;">{{ item }}</span>
        </div>
    </div>
    <div class="flex-column" style="gap: 10px;" v-if="type=='standard'">
        <div style="color: #1a4882;font-weight: 700">{{indexs}}:{{ searchInfo.titles[0] }}</div>
        <div>
            <span>[标准]</span>
            <el-tag type="success" size="small">{{ searchInfo.status }}</el-tag>
            <span>{{ searchInfo.id }}</span>
            <span>公开日：{{ searchInfo.publishDate }}</span>
        </div>
        <div>
            <span class="abstractStyle">{{ searchInfo.abstract }}</span>
        </div>
    </div>
  </div>
</template>

<script>
export default {
    props:{
        searchInfo :{
            type : Object,
            default : ()=>{}
        },
        type:{
            type : String,
            default: 'patent'  //patent为专利发明 periodical为期刊论文 conference为会议论文 cstad为科技成果
        },
        indexs:{
            type:Number,
            default:1
        }
    }
}
</script>

<style scoped>
span{
    margin-right: 10px;
}

.abstractStyle{
    word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

.linkColor{
    color: #417dc9;
}
el-link{
    margin-right: 10px;
}
</style>